package Map
{
	import flash.display.DisplayObjectContainer;
	
	public class CMapTile_Door extends CMapTile
	{
		private const MAX_DOOR_HP	:uint = 10;
		private var m_nDoorHP		:uint = MAX_DOOR_HP;
		
		public function get nDoorHP() :uint { return m_nDoorHP; }
		
		public function CMapTile_Door(nColIndex:int, nRowIndex:int)
		{
			super(CMapTile.TYPE_DOOR, nColIndex, nRowIndex);
			
			m_sprite = new CSprite_MapTile_Door();
			m_sprite.x = nColIndex*TILE_WIDTH;
			m_sprite.y = nRowIndex*TILE_HEIGHT;
			
			CSprite_MapTile_Door(m_sprite).mcHP.gotoAndStop(m_nDoorHP);
		}
		public function DecreaseDoorHP() :void
		{
			if (m_nDoorHP == 0) return;
			m_nDoorHP--;
			
			CSprite_MapTile_Door(m_sprite).mcHP.gotoAndStop(m_nDoorHP);
			
			m_sprite.alpha = Number(m_nDoorHP/MAX_DOOR_HP);
		}
		
	}
}